//
//  DiseaseSymtomViewController.m
//  TestARC
//
//  Created by wuxiaoquan on 12-10-11.
//
//

#import "DiseaseSymtomViewController.h"
#define RowHight 44 

@interface DiseaseSymtomViewController ()

@end

@implementation DiseaseSymtomViewController
@synthesize tableView,symptomArray;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [self addRoundBound:self.tableView];
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
    self.tableView = nil;
    self.symptomArray = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    int numberOfRows = [self.symptomArray count];
//    CGRect oldFrame = self.tableView.frame;
//    CGPoint oldOrigin = oldFrame.origin;
//    CGFloat oldwidth =  oldFrame.size.width;
//    CGFloat newHight = numberOfRows*RowHight;
//    CGRect newFrame = CGRectMake(oldOrigin.x, oldOrigin.y, oldwidth, newHight);
//    
//    self.tableView.frame = newFrame;
    return  numberOfRows;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *SimpleTableIdentifier = @"SimpleTableIdentifier";
    UITableViewCell *cell = nil;
    NSInteger row;
    
    cell = [self.tableView dequeueReusableCellWithIdentifier:SimpleTableIdentifier];
    if (cell==nil) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault
                                     reuseIdentifier:SimpleTableIdentifier];
    }
    row = [indexPath row];
    //NSLog(@"commArray at %d:%@",row,[commonArray objectAtIndex:row]);
    cell.textLabel.text = [[self.symptomArray objectAtIndex:row]objectForKey:@"name"];
    cell.textLabel.font = [UIFont systemFontOfSize:17.0f];
    return cell;
}

@end
